package maple

object PartialFunctionTest {
  val f:PartialFunction[Char,Int] ={
    case '+' => 1
    case '-' => -1
  }


  def main(args: Array[String]): Unit = {
    val res0 = f('+')
    println(res0)

    println(f.isDefinedAt('0'))


    val res2 = "-3+4-5".collect{
      case '+' => 1
      case '-' => -1
    }

    res2.foreach(println)

    /*val res1 = f(0)

    println(res1)*/
  }
}
